import 'package:flutter/material.dart';
import 'package:mi_mang_flutter/manager/app_manager.dart';

import 'dimens.dart';

/// 通用文本样式管理
class TextStyles {
  /// 大号展示文本
  static TextStyle? get displayLarge =>
      Theme.of(AppManager.currentContext).textTheme.displayLarge;

  /// 中号展示文本
  static TextStyle? get displayMedium =>
      Theme.of(AppManager.currentContext).textTheme.displayMedium;

  /// 小号展示文本
  static TextStyle? get displaySmall =>
      Theme.of(AppManager.currentContext).textTheme.displaySmall;

  /// 大号标题文本
  static TextStyle? get headlineLarge =>
      Theme.of(AppManager.currentContext).textTheme.headlineLarge;

  /// 中号标题文本
  static TextStyle? get headlineMedium =>
      Theme.of(AppManager.currentContext).textTheme.headlineMedium;

  /// 小号标题文本
  static TextStyle? get headlineSmall =>
      Theme.of(AppManager.currentContext).textTheme.headlineSmall;

  /// 大号标题文本 [AppBar.title] and [AlertDialog.title]
  static TextStyle? get titleLarge =>
      Theme.of(AppManager.currentContext).textTheme.titleLarge;

  /// 中号标题文本 常用ListTitle标题
  static TextStyle? get titleMedium =>
      Theme.of(AppManager.currentContext).textTheme.titleMedium;

  /// 小号标题文本
  static TextStyle? get titleSmall =>
      Theme.of(AppManager.currentContext).textTheme.titleSmall;

  /// 大号正文文本
  static TextStyle? get bodyLarge =>
      Theme.of(AppManager.currentContext).textTheme.bodyLarge;

  /// 中号正文文本
  static TextStyle? get bodyMedium =>
      Theme.of(AppManager.currentContext).textTheme.bodyMedium;

  /// 小号正文文本
  static TextStyle? get bodySmall =>
      Theme.of(AppManager.currentContext).textTheme.bodySmall;

  /// 大号标签文本 [TextButton] and [ElevatedButton]
  static TextStyle? get labelLarge =>
      Theme.of(AppManager.currentContext).textTheme.labelLarge;

  /// 中号标签文本
  static TextStyle? get labelMedium =>
      Theme.of(AppManager.currentContext).textTheme.labelMedium;

  /// 小号标签文本
  static TextStyle? get labelSmall =>
      Theme.of(AppManager.currentContext).textTheme.labelSmall;

  /// DatePicker 选择框文本
  static TextStyle? get datePickerText =>
      Theme.of(AppManager.currentContext).textTheme.headlineMedium;
}

/// 间隔
class Gaps {
  /// 水平间隔
  static Widget hGap2 = SizedBox(width: Dimens.gapDp2);
  static Widget hGap4 = SizedBox(width: Dimens.gapDp4);
  static Widget hGap5 = SizedBox(width: Dimens.gapDp5);
  static Widget hGap6 = SizedBox(width: Dimens.gapDp6);
  static Widget hGap7 = SizedBox(width: Dimens.gapDp7);
  static Widget hGap8 = SizedBox(width: Dimens.gapDp8);
  static Widget hGap10 = SizedBox(width: Dimens.gapDp10);
  static Widget hGap11 = SizedBox(width: Dimens.gapDp11);
  static Widget hGap12 = SizedBox(width: Dimens.gapDp12);
  static Widget hGap13 = SizedBox(width: Dimens.gapDp13);
  static Widget hGap14 = SizedBox(width: Dimens.gapDp14);
  static Widget hGap15 = SizedBox(width: Dimens.gapDp15);
  static Widget hGap16 = SizedBox(width: Dimens.gapDp16);
  static Widget hGap20 = SizedBox(width: Dimens.gapDp20);
  static Widget hGap50 = SizedBox(width: Dimens.gapDp50);

  /// 垂直间隔
  static Widget vGap4 = SizedBox(height: Dimens.gapDp4);
  static Widget vGap5 = SizedBox(height: Dimens.gapDp5);
  static Widget vGap6 = SizedBox(height: Dimens.gapDp6);
  static Widget vGap8 = SizedBox(height: Dimens.gapDp8);
  static Widget vGap10 = SizedBox(height: Dimens.gapDp10);
  static Widget vGap11 = SizedBox(height: Dimens.gapDp11);
  static Widget vGap12 = SizedBox(height: Dimens.gapDp12);
  static Widget vGap15 = SizedBox(height: Dimens.gapDp15);
  static Widget vGap16 = SizedBox(height: Dimens.gapDp16);
  static Widget vGap17 = SizedBox(height: Dimens.gapDp17);
  static Widget vGap20 = SizedBox(height: Dimens.gapDp20);
  static Widget vGap25 = SizedBox(height: Dimens.gapDp25);
  static Widget vGap30 = SizedBox(height: Dimens.gapDp30);
  static Widget vGap35 = SizedBox(height: Dimens.gapDp35);
  static Widget vGap40 = SizedBox(height: Dimens.gapDp40);
  static Widget vGap45 = SizedBox(height: Dimens.gapDp45);
  static Widget vGap50 = SizedBox(height: Dimens.gapDp50);

  static Widget vStatusBarHeight = SizedBox(height: Dimens.statusBarHeight);
  static Widget vBottomBarHeight = SizedBox(height: Dimens.bottomBarHeight);

  // 空布局
  static Widget empty = SizedBox();

  // // 水平虚线
  // static Widget get hDottedLine {
  //   return DottedPath(
  //     child: Divider(height: Dimens.gapDp1, color: Colors.transparent),
  //     color: Colours.line,
  //     padding: EdgeInsets.symmetric(horizontal: 5.0),
  //   );
  // }

  // // 垂直虚线
  // static Widget get vDottedLine {
  //   return DottedPath(
  //     child: VerticalDivider(width: Dimens.gapDp1, color: Colors.transparent),
  //     color: Colours.line,
  //   );
  // }
}
